package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class WithList {

    private int beginIndex;
    private int endIndex;
    private List<WithListElement> withList;

    public WithList(List<WithListElement> withList) {
        this.beginIndex = withList.get(0).getBeginIndex();
        this.endIndex = withList.get(withList.size() - 1).getEndIndex();
        this.withList = withList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return withList.size();
    }

    public WithListElement get(int index) {
        return withList.get(index);
    }

}
